package com.neiru.divider.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

import com.neiru.divider.R;
import com.neiru.divider.bean.Level;
import com.neiru.divider.bean.Player;
import com.neiru.divider.constants.ActivityConstants;

public class Score extends Activity {
	private Player player = null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		if(savedInstanceState != null) {
			this.player = (Player) savedInstanceState.getSerializable(ActivityConstants.PLAY_LEVEL_DATA_PLAYER);
		}
		if(this.player == null && getIntent().getExtras() != null) {
			this.player = (Player)getIntent().getExtras().getSerializable(ActivityConstants.PLAY_LEVEL_DATA_PLAYER);
		}
		
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.score);
		
		configureText();
	}
	private void configureText() {
		TextView textView = (TextView)findViewById(R.id.scoreText);
		textView.setText(""+player.getScore());
	}
}
